package uk.co.biggroup.lotto.syndicate.dataset;

import java.io.Serializable;

public class DataLineHealthLottery extends DataLine implements Serializable  {

	private static final long serialVersionUID = 7526472295688776147L;
	
	public DataLineHealthLottery(String numbers, String raffle, String lucky) {
		this.setLine(numbers, raffle, lucky);
	}
	@Override
	protected void setLine(String numbers, String raffle, String lucky) {
		this.raffle = raffle;
		this.numbers = numbers;
		this.hit = new boolean[5];
		hit[0] = false;	hit[1] = false; hit[2] = false;
		hit[3] = false;	hit[4] = false;
		
		String[] temp = numbers.split(DELIMITER);
		this.cnumber = new int[temp.length];
		for (int i = 0; i < temp.length; i++) {
			this.cnumber[i] = Integer.parseInt(temp[i]);
		}
		if(lucky.length() > 0) {	
			int counter = 0;
			String[] luckyNb = lucky.split(DELIMITER);
			for(int single : this.cnumber) {
				for (int i = 0; i < temp.length; i++) {
					if(Integer.parseInt(luckyNb[i]) == single) {
						hit[counter] = true;
						counter++;
					} 
				}
				
			}
			this.hitsNo = counter;
		}
	}
 
	@Override
	protected boolean comp(String a, int lcount) {
		// TODO Auto-generated method stub
		return false;
	}


}
